<!DOCTYPE html>
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/base/extension_registry.html">

<script>
'use strict';

// TODO(charliea): This can probably be cleaned up so that we don't have to
// manually wrap the Polymer element names with a function and
// `document.createElement` at each of the registration sites by creating a
// new "Polymer" registration mode.
tr.exportTo('tr.ui.side_panel', function() {
  /**
   * SidePanelRegistry is an entity for side panel Polymer elements to register
   * on so that they'll render a side panel if the model has the correct data.
   *
   * Example usage:
   *
   *   SidePanelRegistry.register(function() {
   *     return document.createElement('my-side-panel');
   *   });
   *
   * @constructor
   */
  function SidePanelRegistry() {}

  const options = new tr.b.ExtensionRegistryOptions(tr.b.BASIC_REGISTRY_MODE);
  tr.b.decorateExtensionRegistry(SidePanelRegistry, options);

  return {
    SidePanelRegistry,
  };
});
</script>
